

import 'package:basic_common/app_theme.dart';
import 'package:basic_common/common_exports.dart';
import 'package:basic_services/model/server_press_detail_data.dart';
import 'package:basic_services/serviceDetail/service_detail_controller.dart';
import 'package:basic_widgets/text_widget.dart';

class PressView extends GetView<ServerDetailController> {
  ServerPressDetailData? detailData;
  PressView({required this.detailData});
  SriList? srLiiData;

  @override
  Widget build(BuildContext context) {
    if (detailData!.sriList != null) {
      List<SriList> list = detailData!.sriList!;

      if (list.isNotEmpty) {
        srLiiData = list[0];
      }
    }
    return Container(
      width: ScreenHelper.screenWidth,
      height: ScreenHelper.height(200),
      alignment: Alignment.center,
      padding: EdgeInsets.symmetric(horizontal: ScreenHelper.width(15)),
      margin: EdgeInsets.symmetric(horizontal: ScreenHelper.width(15)),
      color: Colors.white,
      child: Column(
        children: [
          Container(
            margin: EdgeInsets.symmetric(vertical: 6),
            child: textItemWidget(
                attrName: '收缩压\n(高压)',
                value: '${srLiiData!.systolicPressure} mmHg',
                fontSize: 16,
                valuColor: AppTheme.dartTextColor),
          ),
          Container(
            margin: EdgeInsets.symmetric(vertical: 6),
            child: textItemWidget(
                attrName: '舒张压\n(低压)',
                value: '${srLiiData!.diastolicPressure} mmHg',
                fontSize: 16,
                valuColor: AppTheme.dartTextColor),
          ),
          Container(
            margin: EdgeInsets.symmetric(vertical: 6),
            child: textItemWidget(
                attrName: '心率',
                value: '${srLiiData!.heartRate} 次/分钟',
                fontSize: 16,
                valuColor: AppTheme.dartTextColor),
          ),
        ],
      ),
    );
  }
}
